/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.freedom.imarket.dao;

import java.util.List;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 *
 * @author edoardo
 */
public abstract class AbstractEntityDAO<T>  {
    
    public abstract JpaRepository getRepository();
    
    
     public  List<T> loadAll(){
         PageRequest pr = new PageRequest(0, 20);
         
        return getRepository().findAll(pr).getContent();
    }
}
